package com.chenglu.android.mine.member;

import android.os.Bundle;
import android.widget.ProgressBar;
import android.widget.TextView;

import com.chenglu.android.R;
import com.chenglu.android.common.base.BaseActionBarActivity;
import com.chenglu.android.common.utils.Utils;
import com.chenglu.android.mine.bean.FansListBean;
import com.chenglu.android.mine.bean.MemberCenterBean;
import com.chenglu.android.mine.bean.PosterBean;
import com.chenglu.android.mine.bean.ReturnStringBean;
import com.chenglu.android.mine.member.mvp.contract.MemberContract;
import com.chenglu.android.mine.member.mvp.presenter.MemberPresenter;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * @author: lyj
 * @Created: by Copyright 2023 6 Guangzhou Hongma Technology Co., Ltd. All rights reserved.
 * @Description：经验值详情
 */
public class ExperienceInfoActivity extends BaseActionBarActivity<MemberPresenter> implements MemberContract.View {

    public static final String FANSDATA = "FANSDATA";
    @BindView(R.id.tv_level_member_title)
    TextView tvLevelMemberTitle;
    @BindView(R.id.tv_v_level)
    TextView tvVLevel;
    @BindView(R.id.tv_level_list)
    TextView tvLevelList;
    @BindView(R.id.tv_empiric_value)
    TextView tvEmpiricValue;
    @BindView(R.id.tv_next_level)
    TextView tvNextLevel;
    @BindView(R.id.tv_sub_level)
    TextView tvSubLevel;
    @BindView(R.id.progress_bar)
    ProgressBar progressBar;
    @BindView(R.id.tv_level_number)
    TextView tvLevelNumber;
    @BindView(R.id.tv_all_consume)
    TextView tvAllConsume;
    @BindView(R.id.progress_bar1)
    ProgressBar progressBar1;
    @BindView(R.id.tv_price)
    TextView tvPrice;
    @BindView(R.id.tv_tip)
    TextView tvTip;


    private MemberCenterBean memberCenterBean;

    @Override
    protected int getLayoutId() {
        return R.layout.activity_experience_info;
    }


    @Override
    protected void initView() {
        setCenterText("经验值详情");
        mPresenter = new MemberPresenter();
        mPresenter.attachView(this);

        memberCenterBean = (MemberCenterBean) getIntent().getSerializableExtra(FANSDATA);

        tvLevelMemberTitle.setText(memberCenterBean.getData().getLevelName());//会员等级名称

        tvVLevel.setText("V" + memberCenterBean.getData().getLevel());

        tvEmpiricValue.setText(memberCenterBean.getData().getExperience() + "%");

        tvNextLevel.setText("升级至V"+memberCenterBean.getData().getNextLevel() +"需要完成");

        tvSubLevel.setText("邀请粉丝 "+memberCenterBean.getData().getTargetCount()+ "人"); //邀请粉丝数

        progressBar.setProgress(memberCenterBean.getData().getFansRatio());  //邀请粉丝进度条

        tvLevelNumber.setText(memberCenterBean.getData().getFansCount()+"人");

        tvAllConsume.setText("综合消费 "+ Utils.formatZeroNumber(memberCenterBean.getData().getTargetAmount())+"元");
        progressBar1.setProgress(memberCenterBean.getData().getConsumptionRatio()); //消费完成度
        tvPrice.setText(memberCenterBean.getData().getTotalConsumption()+"元");

        tvTip.setText("1、必须同时满足升级条件才能升级至下一会员 等级 \n2、综合消费=自己消费的金额+所有粉丝消费的金额");


    }

    @Override
    public void getLevelDescriptions(ReturnStringBean bean) {

    }

    @Override
    public void getMemberCenterInfo(MemberCenterBean bean) {

    }

    @Override
    public void getFansPage(FansListBean bean) {

    }

    @Override
    public void getConsumerPage(FansListBean bean) {

    }

    @Override
    public void getPromotionPoster(PosterBean bean) {

    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // TODO: add setContentView(...) invocation
        ButterKnife.bind(this);
    }
}
